<template>
  <div class="supresulttitle"></div>
  <div class="noiseclueanalysisbox">
    <div class="left">
      <div class="box">
        <img src="../../../assets/fengjie/icon34.png" alt="">
        <e-charts id="echarts" ref="chart" :option="dataOption"></e-charts>
      </div>
    </div>
    <div class="right">
      <div class="item">
        <div class="i-left">
          <div class="ik1"></div>
          <span>绿色预警</span>
        </div>
        <div class="i-right i-color1">100条</div>
      </div>
      <div class="item">
        <div class="i-left">
          <div class="ik2"></div>
          <span>黄色预警</span>
        </div>
        <div class="i-right i-color2">240条</div>
      </div>
      <div class="item">
        <div class="i-left">
          <div class="ik3"></div>
          <span>红色预警</span>
        </div>
        <div class="i-right i-color3">21条</div>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import * as echarts from 'echarts';
import { onMounted, ref } from 'vue';
// 配置项
let dataOption = ref({});
// 初始化echarts
function initEcharts() {
  dataOption.value = {
    series: [
      {
        name: 'Access From',
        type: 'pie',
        radius: ['40%', '70%'],
        padAngle: 5,
        itemStyle: {
          borderRadius: 1
        },
        label: {
          show: false,
          position: 'center'
        },
        data: [
          {
            value: 100, name: 'Email', itemStyle: {
              color: new echarts.graphic.LinearGradient(0, 1, 1, 1,
                [
                  { offset: 0, color: 'rgba(38, 157, 107, 0.1)' },
                  { offset: 1, color: 'rgba(38, 157, 107, 1)' },
                ]
              )
            }
          },
          {
            value: 240, name: 'Union Ads', itemStyle: {
              color: new echarts.graphic.LinearGradient(0, 1, 1, 1,
                [
                  { offset: 0, color: 'rgba(255, 191, 0, 0.1)' },
                  { offset: 1, color: 'rgba(255, 191, 0, 1)' },
                ]
              )
            }
          },
          {
            value: 21, name: 'Search Engine', itemStyle: {
              color: new echarts.graphic.LinearGradient(0, 1, 1, 1,
                [
                  { offset: 0, color: 'rgba(255, 103, 78, 0.1)' },
                  { offset: 1, color: 'rgba(255, 103, 78, 1)' },
                ]
              )
            }
          },
        ]
      }
    ]
  }
}
onMounted(() => {
  initEcharts();
});
</script>

<style lang="less" scoped>
.supresulttitle {
  width: 100%;
  height: 36px;
  margin-top: 9px;
  background-image: url("../../../assets/fengjie/icon15.png");
  background-size: 100% 100%;
}

.noiseclueanalysisbox {
  width: 85%;
  height: 136px;
  margin-top: 9px;
  background-image: url("../../../assets/fengjie/icon16.png");
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  .left {
    width: 115px;
    height: 115px;
    display: flex;
    align-items: center;
    background-image: url('../../../assets/icon7.png');
    background-size: 100% 100%;

    .box {
      width: 115px;
      height: 115px;
      position: relative;

      img {
        width: 55px;
        height: 55px;
        position: absolute;
        left: calc(50% - 27.5px);
        top: calc(50% - 27.5px);
      }

      #echarts {
        width: 125px;
        height: 125px;
        position: absolute;
        left: -5px;
        top: -5px;
      }
    }
  }

  .right {
    width: 150px;
    margin-left: 40px;

    .item {
      width: 150px;
      height: 30px;
      background-image: url('../../../assets/icon11.png');
      background-size: 100% 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin: 7px 0;
      box-sizing: border-box;
      padding: 0 0 0 10px;

      .i-left {
        display: flex;
        align-items: center;

        .ik1 {
          width: 8px;
          height: 8px;
          background: #269D6B;
        }

        .ik2 {
          width: 8px;
          height: 8px;
          background: #FFBF00;
        }

        .ik3 {
          width: 8px;
          height: 8px;
          background: #FF674E;
        }

        span {
          font-family: PingFangSC-Regular;
          font-weight: 400;
          font-size: 12.88px;
          color: #FFFFFF;
          margin-left: 11px;
        }
      }
      .i-color1{
          color: #269D6B;
        }
        .i-color2{
          color: #FFBF00;
        }
        .i-color3{
          color: #FF674E;
        }
      .i-right {
        font-family: PingFangSC-Regular;
        font-weight: 400;
        font-size: 14px;
      }
    }
  }
}
</style>
